import request from './request'
export const getquestions = (params) => {
  return request({
    url: '/api/admin/questions',
    method: 'GET',
    params
  })
}

export const getquestionlist = () => {
  return request({
    url: '/api/admin/questionList',
    method: 'GET'
  })
}

// 删除
export const deletequestion = (qid) => {
  return request({
    url: `/api/admin/question/${qid}`,
    method: 'DELETE'
  })
}

// id查询
export const getquestionfromid = (qid) => {
  return request({
    url: `/api/admin/question/${qid}`,
    method: 'GET'
  })
}

// 添加问题
export const addquestion = (data) => {
  return request({
    url: '/api/admin/question',
    method: 'POST',
    data
  })
}

// 修改问题
export const editquestion = (data) => {
  return request({
    url: '/api/admin/question',
    method: 'PUT',
    data
  })
}
